import { saveOrUpdate } from './api'
import { SubmitDTO } from './data.d'

// 新增
export const add = async (formData: SubmitDTO) => {
  const { description, name, parentId } = formData
  const res = await saveOrUpdate({ description, name, parentId })
  return res.code === 0
}
// 更新
export const update = async (formData: SubmitDTO) => {
  const { description, name, id, parentId } = formData
  const res = await saveOrUpdate({ description, name, id, parentId })
  return res.code === 0
}
